{include file="public/header" select="2" /}
<body style="padding-top: 0">

<div id="app">
    <ul class="address-list">
        {foreach name="list" item="vo"}
        <li class="choice" data-id="{$vo.id}">
            <van-swipe-cell>
                <div class="address-only">
                    <div class="flex-layout">
                        <div class="left">{$vo.nickname} {$vo.tel}
                            {if $vo.default == 1}<p>默认</p>{/if}
                        </div>
                    </div>
                    <div>{$vo.p.title}{$vo.c.title}{$vo.d.title}{$vo.details}</div>
                </div>
            </van-swipe-cell>
        </li>
        {/foreach}
    </ul>
</div>
<div style="height: 100px"></div>

<p class="save save-fixed upd-save" >管理收货地址</p>

</body>
{include file="public/footer" select="0" /}
<script src="/static/index/js/vue.js"></script>
<script src="/static/index/js/vant.js"></script>
<script>
    new Vue({
        el: '#app'
    });
    $('.choice').click(function (e) {
        var id = $(this).attr('data-id');
        _ajax('{:url("address/choice")}', {id: id});
    })
    $(".save-fixed").click(function () {
        if (window.name != '') {
            var index = parent.layer.getFrameIndex(window.name);
            parent.layer.close(index);
            parent.window.location.href = "{:url('address/index')}";
        } else {
            window.location.reload();
        }
    });

</script>
